Add WFI in platform's unexpected error handlers
authorSandrine Bailleux <[email protected]>
Thu, 18 Aug 2016 08:24:40 +0000 (09:24 +0100)
committerSandrine Bailleux <[email protected]>
Fri, 19 Aug 2016 13:04:03 +0000 (14:04 +0100)
This patch adds a WFI instruction in the default implementations of
plat_error_handler() and plat_panic_handler(). This potentially reduces
power consumption by allowing the hardware to enter a low-power state.
The same change has been made to the FVP and Juno platform ports.

Change-Id: Ia4e6e1e5bf1ed42efbba7d0ebbad7be8d5f9f173

plat/arm/board/fvp/fvp_err.c
plat/arm/board/juno/juno_err.c
plat/common/aarch64/platform_helpers.S

index 7867e49c4685c4139c51dd09ecb10631b16feca1..f8ea6a032f86f69c9f08e7b865aa0e3c63049f4e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -28,6 +28,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <arch_helpers.h>
 #include <board_arm_def.h>
 #include <debug.h>
 #include <errno.h>
@@ -61,5 +62,5 @@ void plat_error_handler(int err)
 
        /* Loop until the watchdog resets the system */
        for (;;)
-               ;
+               wfi();
 }
index 497cc7fa3c7cbc02498501c9db42a42cbf178d16..fa19da7649d447ec0de922012784d802ea058afc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -28,6 +28,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <arch_helpers.h>
 #include <errno.h>
 #include <v2m_def.h>
 
@@ -45,5 +46,5 @@ void plat_error_handler(int err)
 
        /* Loop until the watchdog resets the system */
        for (;;)
-               ;
+               wfi();
 }
index 08638303a5a6f98684a8b25fe00c2e9f46d3864c..a134ded028d431811134ede90eac6508bf8e132e 100644 (file)
@@ -130,6 +130,7 @@ endfunc bl1_plat_prepare_exit
         * -----------------------------------------------------
         */
 func plat_error_handler
+       wfi
        b       plat_error_handler
 endfunc plat_error_handler
 
@@ -139,5 +140,6 @@ endfunc plat_error_handler
         * -----------------------------------------------------
         */
 func plat_panic_handler
+       wfi
        b       plat_panic_handler
 endfunc plat_panic_handler